package main

import (
	"Projects/NoteSync/internal/config"
	"Projects/NoteSync/internal/handler"

	"github.com/qf-tech/qftech-base/pkg/log"
	qflog "github.com/qf-tech/qftech-base/pkg/log"
)

func logInit() {
	config := &qflog.LogConfig{
		MaxCount: config.SvrConfig.Log.FileCount,
		MaxSize:  config.SvrConfig.Log.FileSize,
		Compress: true,
		FilePath: config.SvrConfig.Log.FilePath,
		Level:    qflog.LogLevel(config.SvrConfig.Log.Level),
		Format:   qflog.LogFormat(config.SvrConfig.Log.FileFormat),
	}
	qflog.Init(config)
}

func main() {
	config.Init()
	logInit()
	log.Sugare.Infof("trans2html: %v", config.SvrConfig.Server.Trans2Html)
	go handler.FileSyncLoop(config.SvrConfig.Server.NotePath, config.SvrConfig.Server.StorePth)
	select {}
}
